/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Verito Ramirez
 *         Victor Jaramillo
 */
@Entity
@Table(name = "cxp_datoadicionalfactura")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CxpDatoAdicionalFactura.findAll", query = "SELECT s FROM CxpDatoAdicionalFactura s"),
    @NamedQuery(name = "CxpDatoAdicionalFactura.findBycxpCodigoDatAdiFac", query = "SELECT s FROM CxpDatoAdicionalFactura s WHERE s.cxpCodigoDatAdiFac = :cxpCodigoDatAdiFac"),
    @NamedQuery(name = "CxpDatoAdicionalFactura.findBycxpValorDatAdiFac", query = "SELECT s FROM CxpDatoAdicionalFactura s WHERE s.cxpValorDatAdiFac = :cxpValorDatAdiFac"),
    @NamedQuery(name = "CxpDatoAdicionalFactura.findBycxpCodigoDetFac", query = "SELECT s FROM CxpDatoAdicionalFactura s WHERE s.cxpCodigoDetFac = :cxpCodigoDetFac")})
public class CxpDatoAdicionalFactura implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "CXP_CODIGO_DATADIFAC")
    private String cxpCodigoDatAdiFac;
    @Size(max = 30)
    @Column(name = "CXP_VALOR_DATADIFAC")
    private Double cxpValorDatAdiFac;
    @Size(max = 30)
    @Column(name = "CXP_CODIGO_DETFAC")
    private String cxpCodigoDetFac;    
    
    public CxpDatoAdicionalFactura() {
    }
    
    public CxpDatoAdicionalFactura(String cxpCodigoDatAdiFac) {
        this.cxpCodigoDatAdiFac = cxpCodigoDatAdiFac;
    }

    public CxpDatoAdicionalFactura(String cxpCodigoDatAdiFac, Double cxpValorDatAdiFac,  String cxpCodigoDetFac) {
        this.cxpCodigoDatAdiFac = cxpCodigoDatAdiFac;
        this.cxpValorDatAdiFac = cxpValorDatAdiFac;
        this.cxpCodigoDetFac = cxpCodigoDetFac;
    }

    public String getCxpCodigoDatAdiFac() {
        return cxpCodigoDatAdiFac;
    }

    public void setCxpCodigoDatAdiFac(String cxpCodigoDatAdiFac) {
        this.cxpCodigoDatAdiFac = cxpCodigoDatAdiFac;
    }

    public String getCxpCodigoDetFac() {
        return cxpCodigoDetFac;
    }

    public void setCxpCodigoDetFac(String cxpCodigoDetFac) {
        this.cxpCodigoDetFac = cxpCodigoDetFac;
    }

    public Double getCxpValorDatAdiFac() {
        return cxpValorDatAdiFac;
    }

    public void setCxpValorDatAdiFac(Double cxpValorDatAdiFac) {
        this.cxpValorDatAdiFac = cxpValorDatAdiFac;
    }

   

    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cxpCodigoDatAdiFac != null ? cxpCodigoDatAdiFac.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CxpDatoAdicionalFactura)) {
            return false;
        }
        CxpDatoAdicionalFactura other = (CxpDatoAdicionalFactura) object;
        if ((this.cxpCodigoDatAdiFac == null && other.cxpCodigoDatAdiFac != null) || (this.cxpCodigoDatAdiFac != null && !this.cxpCodigoDatAdiFac.equals(other.cxpCodigoDatAdiFac))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "clases.CxpDatoAdicionalFactura[ cxpCodigoDatAdiFac=" + cxpCodigoDatAdiFac + " ]";
    }
    
}
